/*
** str.c for  in /u/all/caille_c/cu/public/colle
** 
** Made by carole cailleux
** Login   <caille_c@epitech.net>
** 
** Started on  Mon Apr 26 21:31:34 2010 carole cailleux
** Last update Mon Apr 26 21:41:41 2010 carole cailleux
*/

#include <stdlib.h>
#include "starwars.h"

char		*my_strdup(char *str)
{
  char		*res;
  int		i;

  i = 0;
  res = xmalloc(sizeof(*res) * my_strlen(str) + 1);
  while (str[i] != '\0')
    {
      res[i] = str[i];
      i++;
    }
  res[i] = '\0';
  return (res);
}

int		compare_str(char *s1, char *s2)
{
  int		i;

  i = 0;
  if (s1 == NULL || s2 == NULL)
    return (0);
  while (s1[i] && s2[i] && s1[i] == s2[i])
    i++;
  if (i == my_strlen(s1) && i == my_strlen(s2))
    return (1);
  return (0);
}
